package com.xcity.pomelo.response;

import com.xcity.db.entity.Mine;
import com.xcity.game.map.MapService;

import naga.x.game.time.TimeUpdater;
import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class MineExtendResponse extends Response {
	private long ownerId;
	private int map;
	private int pos;
	private int leftSecond;
	public MineExtendResponse(int serial, Mine mine) {
		super(serial);
		ownerId = mine.getOwnerId();

		leftSecond = (int) ((mine.getTakeTime() + (mine.getExtendCount()) * MapService.TAKE_MAX_DURATION - TimeUpdater.getInstance().now()) / 1000L);
		if(leftSecond < 0){
			leftSecond = 0;
		}
		map = mine.getMap();
		pos = mine.getPos();
	}
	public long getOwnerId() {
		return ownerId;
	}
	public void setOwnerId(long ownerId) {
		this.ownerId = ownerId;
	}
	public int getMap() {
		return map;
	}
	public void setMap(int map) {
		this.map = map;
	}
	public int getPos() {
		return pos;
	}
	public void setPos(int pos) {
		this.pos = pos;
	}
	public int getLeftSecond() {
		return leftSecond;
	}
	public void setLeftSecond(int leftSecond) {
		this.leftSecond = leftSecond;
	}
	
}
